*****************************************************************************
* Targeting of Chinese Tariffs & Mid-term Elections (County-level Analysis) * 
*****************************************************************************

use "tradewar_io_county.dta", clear

* Table 2: Counties Targeted by Retaliatory Tariffs

eststo clear
eststo: xi: reg emp_chn_target_april county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_chn_target_april county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

eststo: xi: reg emp_chn_target_june county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_chn_target_june county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

eststo: xi: reg emp_chn_target_aug county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_chn_target_aug county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

eststo: xi: reg emp_chn_target_sept county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_chn_target_sept county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

esttab using "Table2.tex", label keep(county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416) addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "") 

* Table 4: Retaliatory Tariffs and Mid-term Election

gen emp_chn_target = emp_chn_target_april 
label var emp_chn_target "\%, Targeted by Chinese Tariffs"
gen emp_us_target = emp_us_protect_cum_june 
label var emp_us_target "\%, Protected by US Tariffs"

eststo clear
eststo: xi: reg delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_june 
eststo: xi: reg delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: reg delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_sept 
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: reg delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416  i.state_fips [aw= voting_age_pop], robust

esttab using "Table4.tex", label keep(emp_chn_target emp_us_target delta_repshare1416 avg_wkly_wage_pct_chg1718 ) order(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_repshare1416 ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table 5: Retaliatory Tariffs and Voter Turnout

eststo clear
replace emp_chn_target = emp_chn_target_april
eststo: xi: reg delta_totalvotes18 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_totalvotes18 emp_chn_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_totalvotes16  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_june 
eststo: xi: reg delta_totalvotes18 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_totalvotes18 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_totalvotes16  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_aug 
replace emp_us_target = emp_us_protect_cum_aug 
eststo: xi: reg delta_totalvotes18 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_totalvotes18 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_totalvotes16  i.state_fips [aw= voting_age_pop], robust

replace emp_chn_target = emp_chn_target_cum_sept 
replace emp_us_target = emp_us_protect_cum_sept 
eststo: xi: reg delta_totalvotes18 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_totalvotes18 emp_chn_target emp_us_target female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_totalvotes16  i.state_fips [aw= voting_age_pop], robust

esttab using "Table5.tex", label keep(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_totalvotes16) order(emp_chn_target emp_us_target avg_wkly_wage_pct_chg1718 delta_totalvotes16   ) indicate("State FE = *state_fip*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

* Table 6: Political Targeting of Retaliatory Tariffs by the EU, Canada and Mexico

eststo clear
eststo: xi: reg emp_eu_target county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_eu_target county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

eststo: xi: reg emp_can_target county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_can_target county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

eststo: xi: reg emp_mex_target county_repshare_house1416 swing_dist_20_1416 i.state_fips [aw=voting_age_pop], robust
eststo: xi: reg emp_mex_target county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416 i.state_fips [aw=voting_age_pop], robust

esttab using "Table6.tex", label keep(county_repshare_house1416 swing_dist_20_1416 repcounty_swing_20_1416) indicate("State FE = *state_fip*" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}" "Observations are weighted by counties' total voting age population in 2016.") nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "")

* Table 7: Retaliatory Tariffs and Mid-term Election, by Trading Partner

gen emp_target = emp_eu_target
label var emp_target "Targeted by Retaliatory Tariffs, \%"	

eststo clear 
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

replace emp_target = emp_can_target
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

replace emp_target = emp_mex_target
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

replace emp_target = emp_eumexcan_target
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 i.state_fips [aw= voting_age_pop], robust
eststo: xi: reg delta_repshare1618 emp_target emp_us_protect_cum_sept female_share2016 white_share2016 black_share2016 asian_share2016 native_share2016 hispanic_share2016 age_group1_2016_share age_group2_2016_share age_group3_2016_share age_group4_2016_share age_group5_2016_share age_group6_2016_share age_group7_2016_share age_group8_2016_share age_group9_2016_share age_group10_2016_share age_group11_2016_share age_group12_2016_share age_group13_2016_share age_group14_2016_share age_group15_2016_share age_group16_2016_share age_group17_2016_share avg_wkly_wage_pct_chg1718 delta_repshare1416 i.state_fips [aw= voting_age_pop], robust

esttab using "Table7.tex", label keep(emp_target emp_us_protect_cum_sept delta_repshare1416 avg_wkly_wage_pct_chg1718 ) order(emp_target emp_us_protect_cum_sept avg_wkly_wage_pct_chg1718 delta_repshare1416 ) indicate("State FE = *state*"  "Demographic Controls = female_share2016" )  addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "")

*********************************************************
* Targeting of Chinese Tariffs (Product-level Analysis) * 
*********************************************************

* Table 3: Product-Level Analysis of Chinese Tariffs

use "tradewar_io_product.dta", clear

eststo clear
eststo: dprobit china_tgt_april gop_concentration log_us_export_chn chn_import_share_us, robust
eststo: dprobit china_tgt_june gop_concentration log_us_export_chn chn_import_share_us if china_tgt_april == 0, robust
eststo: dprobit china_tgt_aug gop_concentration log_us_export_chn chn_import_share_us if china_tgt_april == 0 & china_tgt_june == 0, robust
eststo: dprobit china_tgt_sept gop_concentration log_us_export_chn chn_import_share_us if china_tgt_april == 0 & china_tgt_june == 0 & china_tgt_aug == 0, robust
esttab using "Table3.tex", label keep(gop_concentration log_us_export_chn chn_import_share_us)  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress margin nogaps nodepvars mtitles("" "" "" "") 

********************************************
* Campaign Communications on the Trade War * 
********************************************

* Table 8: Retaliatory Tariffs and Campaign Communications on the Trade War

use "tradewar_io_campaign.dta", clear

gen target = emp_chn_target_april 
label var target "\%, Targeted by Tariffs"
gen dem_target = dem_emp_chn_target_april
label var dem_target "\%, Targeted by Tariffs * Democratic"

eststo clear
eststo: regress trade_prop democrat target, robust
eststo: regress trade_prop democrat target dem_target, robust

replace target = emp_chn_target_june
replace dem_target = dem_emp_chn_target_june

eststo: regress trade_prop democrat target, robust
eststo: regress trade_prop democrat target dem_target, robust

replace target = emp_chn_target_aug
replace dem_target = dem_emp_chn_target_aug

eststo: regress trade_prop democrat target, robust
eststo: regress trade_prop democrat target dem_target, robust

replace target = emp_chn_target_sept
replace dem_target = dem_emp_chn_target_sept

eststo: regress trade_prop democrat target, robust
eststo: regress trade_prop democrat target dem_target, robust

esttab using "Table8.tex", label keep(democrat target dem_target) order(democrat target dem_target) addnotes("Robust standard errors in parentheses." "\textit{+p < 0.10, * p < 0.05, ** p < 0.01}")  nonotes se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "" "" "")

****************************************
* Web Search Patterns on the Trade War * 
****************************************

* Table 9: Retaliatory Tariffs and Web-Searches on Trade War

use "tradewar_io_websearch.dta", replace

eststo clear
eststo: reg search_ch_tariffs emp_chn_target_metro edu_college edu_graduate, robust
eststo: xi: reg search_ch_tariffs emp_chn_target_metro edu_college edu_graduate i.state_fips, robust
eststo: reg search_tradewar emp_chn_target_metro edu_college edu_graduate, robust
eststo: xi: reg search_tradewar emp_chn_target_metro edu_college edu_graduate i.state_fips, robust
esttab using "Table9.tex", label  keep(emp_chn_target_metro edu_college edu_graduate) indicate("State FE = *state*") se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "")

***********************************
* Public Opinion on the Trade War * 
***********************************

use "tradewar_io_survey.dta", replace

* Table 10: Views on Impact of the Trade War and Assignment of Responsibility

eststo clear
eststo: areg Dchinaonus industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female naicsmissing, absorb(state) cl(state)
eststo: areg Dchinaonarea industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female usnative naicsmissing, absorb(state) cl(state)
eststo: areg Dchinaonfam industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female usnative naicsmissing, absorb(state) cl(state)
eststo: areg trump industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female usnative naicsmissing, absorb(state) cl(state)
eststo: areg goprole industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female usnative naicsmissing, absorb(state) cl(state)
eststo: areg demrole industry_chn_target cty_chn_target cty_us_protect i.education i.race i.emp_status age usnative female usnative naicsmissing, absorb(state) cl(state)
esttab using "Table10.tex", label  keep(industry_chn_target cty_chn_target cty_us_protect) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "" "")

* Table 11: Views on the Trade War and Assignment of Responsibility, by Perceived Impact of Chinese Tariffs on Family

eststo clear
eststo: areg Dchinaonus Dchinaonfamily democrat independent i.education i.race i.emp_status age usnative female, absorb(state) cl(state)
eststo: areg Dchinaonarea Dchinaonfamily democrat independent i.education i.race i.emp_status age usnative female, absorb(state) cl(state)
eststo: areg trump Dchinaonfamily democrat independent i.education i.race i.emp_status age usnative female, absorb(state) cl(state)
eststo: areg goprole Dchinaonfamily democrat independent i.education i.race i.emp_status age usnative female, absorb(state) cl(state)
eststo: areg demrole Dchinaonfamily democrat independent i.education i.race i.emp_status age usnative female, absorb(state) cl(state)
esttab using "Table11.tex", label  keep(Dchinaonfamily democrat independent) se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars mtitles("" "" "" "" "")
